<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css" href="${base}/js/system/layui/css/layui.css"/>
	<link rel="stylesheet" type="text/css" href="${base}/css/system/bootstrap/bootstrap.min.css"/>
	<link rel="stylesheet" type="text/css" href="${base}/css/development/subway.css"/>
	<script type="text/javascript" src="${base}/js/system/jquery.min.js"></script>
	<script type="text/javascript" src="${base}/js/system/jquery.serializejson.js"></script>
	<script type="text/javascript" src="${base}/js/system/layer/layer.js"></script>
	<script type="text/javascript" src="${base}/js/system/layui/lay/dest/layui.all.js"></script>
	<script type="text/javascript" src="${base}/js/system/layui/dataTable.js"></script>

</head>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page language="java" import="com.zhuozhengsoft.pageoffice.*" %>
<%@ page language="java" import="com.zhuozhengsoft.pageoffice.wordwriter.*" %>
<%@ taglib uri="http://java.pageoffice.cn" prefix="po" %>
<%
String title = (String)request.getAttribute("fileTitle");
WordDocument docx = (WordDocument)request.getAttribute("docx");
String url = (String)request.getAttribute("filePath");
String engid = (String)request.getAttribute("engid");
PageOfficeCtrl poCtrl = new PageOfficeCtrl(request);
//设置打开的Word文档的主题
poCtrl.setTheme(ThemeType.Office2010);
//隐藏Office工具条
poCtrl.setOfficeToolbars(false);
//隐藏自定义工具栏
poCtrl.setCustomToolbar(false);
//设置页面的显示标题
poCtrl.setCaption(title);
poCtrl.setWriter(docx);

/* //设置office办公软件类型
poCtrl.setOfficeVendor(OfficeVendorType.WPSOffice); */

poCtrl.setServerPage(request.getContextPath()+"/poserver.do"); //此行必须
//添加自定义按钮
poCtrl.addCustomToolButton("保存","Save()",1);
//设置保存页面
poCtrl.setSaveFilePage(request.getContextPath()+url);
poCtrl.webCreateNew("武汉思恒达科技有限公司",DocumentVersion.Word2007);
poCtrl.setJsFunction_AfterDocumentSaved("AfterDocumentSaved");
poCtrl.setTagId("PageOfficeCtrl"); //此行必须
%>
<body>
<#
include("/include/dataTableTemplate.html",{}){}
include("/include/dcenter/dcTemplate.html",{}){}
#>
<input type="hidden" id="project_id" value="${obj.project_id}">
<input type="hidden" id="design_cell_id" value="${obj.design_cell_id}">
<div style=" width:auto; height:750px;width:1280px;margin: 0 auto;">
	<po:PageOfficeCtrl id="PageOfficeCtrl"></po:PageOfficeCtrl>
</div>
<script>
    var base = "${base}";
    var project_id = $.trim($("#project_id").val());
    var design_cell_id = $.trim($("#design_cell_id").val());
    function Save() {
        document.getElementById("PageOfficeCtrl").WebSave();
    }

    function AfterDocumentSaved(){
        alert("保存成功");
        layer.msg('保存成功。', {
            icon : 6
        });
        setTimeout(function() {
        }, 1500);
    }
    function BeforeBrowserClosed(){

		Save();
		return  true;
    }
</script>
<script type="text/javascript" src="${base}/js/development/projectcenter/designcell/designCell.js"></script>
</body>
</html>